package com.atwisdom.star.core.dao.service.impl;

import com.atwisdom.star.core.dao.pojo.PlannerRelationInstance;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atwisdom.star.core.dao.pojo.OaprocessRelationInstance;
import com.atwisdom.star.core.dao.service.OaprocessRelationInstanceService;
import com.atwisdom.star.core.dao.mapper.OaprocessRelationInstanceMapper;
import org.springframework.stereotype.Service;

/**
* @author fushb
* @description 针对表【oaprocess_relation_instance】的数据库操作Service实现
* @createDate 2023-03-30 14:27:39
*/
@Service
public class OaprocessRelationInstanceServiceImpl extends ServiceImpl<OaprocessRelationInstanceMapper, OaprocessRelationInstance>
    implements OaprocessRelationInstanceService{
    @Override
    public int realDelete(QueryWrapper<OaprocessRelationInstance> wrapper){
        return this.baseMapper.realDelete(wrapper);
    }

    /**
     * 同步更新实例类名称
     * @param sourceClassName 原类名
     * @param newClassName 新类名
     * @return 返回结果
     */
    @Override
    public int updateClassName(String sourceClassName, String newClassName) {
        QueryWrapper<OaprocessRelationInstance> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("className", sourceClassName);
        OaprocessRelationInstance oaprocessRelationInstance = new OaprocessRelationInstance();
        oaprocessRelationInstance.setClassName(newClassName);
        return this.baseMapper.update(oaprocessRelationInstance, queryWrapper);
    }
}




